bash-completion: Don't add a space after files and directories
authorMatthew Leeds <matthew.leeds@endlessm.com>
Thu, 24 May 2018 07:08:57 +0000 (00:08 -0700)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 24 May 2018 12:59:49 +0000 (12:59 +0000)
Currently if ostree is completing a file or directory for you it adds a
space to the end, but this is an inconvenience when it's an intermediate
directory in a tree. It's better to let the user add the space after the
final directory, so this commit changes the bash completion to avoid
adding a space when completing files or directories.

Closes: #1598
Approved by: jlebon

bash/ostree

index 218e4254f960a42801d351c5ea9cf2a563d353c9..46baa51b23d74230a14f01789b4bd1eb3110714b 100644 (file)
@@ -87,10 +87,12 @@ __ostree_compreply_all_options() {
 }
 
 __ostree_compreply_all_files() {
+    compopt -o nospace
     COMPREPLY+=( $( compgen -f "$cur" ) )
 }
 
 __ostree_compreply_dirs_only() {
+    compopt -o nospace
     COMPREPLY+=( $( compgen -d "$cur" ) )
 }